package br.com.fcomota.pi_iv_sie.utils;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import br.com.fcomota.pi_iv_sie.modelo.Usuario;

public class BD_SQLite extends SQLiteOpenHelper {
	private static final String NOME_BD = "SIE";
	private static final int VERSAO_BD = 4;
	
	
	public BD_SQLite(Context ctx){
		super(ctx, NOME_BD, null, VERSAO_BD);
	}
	
	
	@Override
	public void onCreate(SQLiteDatabase bd) {
		bd.execSQL("create table usuario(_id integer primary key autoincrement, nome text not null, senha text not null);");
	}

	@Override
	public void onUpgrade(SQLiteDatabase bd, int arg1, int arg2) {
		bd.execSQL("drop table usuario;");
		onCreate(bd);
	}

}
